'''
@Company: TWL
@Author: xue jian
@Email: xuejian@kanzhun.com
@Date: 2020-05-20 11:32:48
'''
# -*- coding: UTF-8 -*-
# coding=utf-8
from subprocess import Popen, PIPE
from hdfs.client import Client
class test(object):
    @staticmethod
    def hdfs_test():
      client= Client("http://bx-namenode-01:50070")
      with  client.read("/basicdata/kafka/boss/arc/recommender/bossrec_fid_flow/ds=2020-05-20/hour=00") as  reader:
          for line in reader:
           print(line)


if __name__ == '__main__':
       test.hdfs_test()


# def train2(self):

#     proc = Popen(self.shell_p, shell=True, stdin=PIPE)
#     print('process start')
#     for date in self.dates:
#         print(date)
#         with open(self.f_path + date, 'rb') as f_date:
#             print(self.f_path + date)
#             line = f_date.readline()
#             while line != b'':
#                 if line == b'':
#                     break
#                 proc.stdin.write(line)
#                 proc.stdin.flush()
#                 line = f_date.readline()

#     proc.stdin.close()
#     proc.wait()

# class CasHdfsTrain:
#     def __init__(self, )